<?php
namespace app\car\controller;
use app\AdminRest;

use app\car\model\ArticleCate;
use app\car\model\ArticleList;
use app\car\model\ScreenColor;
use app\car\model\ScreenDisplacement;
use app\car\model\ScreenMileage;
use app\car\model\ScreenModel;
use app\car\model\ScreenPrice;
use app\car\model\ScreenStandard;
use app\car\model\ScreenYear;
use app\shop\model\IndexCompany;
use think\App;




class AdminSetting extends AdminRest
{

    protected $model;

    protected $cate_model;



    public function __construct(App $app) {

        parent::__construct($app);

        $this->model  = new ArticleList();

        $this->cate_model  = new ArticleCate();


    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:颜色筛选列表
     */
    public function colorList(){

        $input = $this->_param;

        $color_model = new ScreenColor();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $color_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }






    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加颜色筛选
     */
    public function colorAdd(){

        $input = $this->_input;

        $color_model = new ScreenColor();

        $input['uniacid'] = $this->_uniacid;

        $data = $color_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑颜色筛选
     */
    public function colorUpdate(){

        $input = $this->_input;

        $color_model = new ScreenColor();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $color_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:分类详情
     */
    public function colorInfo(){

        $input = $this->_param;

        $color_model = new ScreenColor();

        $dis = [

            'id' => $input['id']
        ];

        $data = $color_model->dataInfo($dis);

        return $this->success($data);

    }




    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:排量列表
     */
    public function displacementList(){

        $input = $this->_param;

        $displacement_model = new ScreenDisplacement();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $displacement_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加排量
     */
    public function displacementAdd(){

        $input = $this->_input;

        $displacement_model = new ScreenDisplacement();

        $input['uniacid'] = $this->_uniacid;

        $data = $displacement_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑排量
     */
    public function displacementUpdate(){

        $input = $this->_input;

        $displacement_model = new ScreenDisplacement();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $displacement_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:排量详情
     */
    public function displacementInfo(){

        $input = $this->_param;

        $displacement_model = new ScreenDisplacement();

        $dis = [

            'id' => $input['id']
        ];

        $data = $displacement_model->dataInfo($dis);

        return $this->success($data);

    }



    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:车型列表
     */
    public function modelList(){

        $input = $this->_param;

        $model_model = new ScreenModel();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $model_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加车型
     */
    public function modelAdd(){

        $input = $this->_input;

        $model_model = new ScreenModel();

        $input['uniacid'] = $this->_uniacid;

        $data = $model_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑车型
     */
    public function modelUpdate(){

        $input = $this->_input;

        $model_model = new ScreenModel();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $model_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:车型详情
     */
    public function modelInfo(){

        $input = $this->_param;

        $model_model = new ScreenModel();

        $dis = [

            'id' => $input['id']
        ];

        $data = $model_model->dataInfo($dis);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:里程列表
     */
    public function mileageList(){

        $input = $this->_param;

        $mil_model = new ScreenMileage();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $mil_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加里程
     */
    public function mileageAdd(){

        $input = $this->_input;

        $mil_model = new ScreenMileage();

        $input['uniacid'] = $this->_uniacid;

        $data = $mil_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑里程
     */
    public function mileageUpdate(){

        $input = $this->_input;

        $mil_model = new ScreenMileage();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $mil_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:里程详情
     */
    public function mileageInfo(){

        $input = $this->_param;

        $mil_model = new ScreenMileage();

        $dis = [

            'id' => $input['id']
        ];

        $data = $mil_model->dataInfo($dis);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:里程列表
     */
    public function standardList(){

        $input = $this->_param;

        $stan_model = new ScreenStandard();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $stan_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加里程
     */
    public function standardAdd(){

        $input = $this->_input;

        $stan_model = new ScreenStandard();

        $input['uniacid'] = $this->_uniacid;

        $data = $stan_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑里程
     */
    public function standardUpdate(){

        $input = $this->_input;

        $stan_model = new ScreenStandard();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $stan_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:里程详情
     */
    public function standardInfo(){

        $input = $this->_param;

        $stan_model = new ScreenStandard();

        $dis = [

            'id' => $input['id']
        ];

        $data = $stan_model->dataInfo($dis);

        return $this->success($data);

    }




    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:里程列表
     */
    public function yearList(){

        $input = $this->_param;

        $year_model = new ScreenYear();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $year_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加里程
     */
    public function yearAdd(){

        $input = $this->_input;

        $year_model = new ScreenYear();

        $input['uniacid'] = $this->_uniacid;

        $data = $year_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑里程
     */
    public function yearUpdate(){

        $input = $this->_input;

        $year_model = new ScreenYear();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $year_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:里程详情
     */
    public function yearInfo(){

        $input = $this->_param;

        $year_model = new ScreenYear();

        $dis = [

            'id' => $input['id']
        ];

        $data = $year_model->dataInfo($dis);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:58
     * @功能说明:里程列表
     */
    public function priceList(){

        $input = $this->_param;

        $price_model = new ScreenPrice();

        $dis[] = ['status','>',-1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $price_model->dataList($dis,$input['limit']);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:添加里程
     */
    public function priceAdd(){

        $input = $this->_input;

        $price_model = new ScreenPrice();

        $input['uniacid'] = $this->_uniacid;

        $data = $price_model->dataAdd($input);

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:编辑里程
     */
    public function priceUpdate(){

        $input = $this->_input;

        $price_model = new ScreenPrice();

        $dis = [

            'id' => $input['id']
        ];

        $input['uniacid'] = $this->_uniacid;

        $data = $price_model->dataUpdate($dis,$input);

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:里程详情
     */
    public function priceInfo(){

        $input = $this->_param;

        $price_model = new ScreenPrice();

        $dis = [

            'id' => $input['id']
        ];

        $data = $price_model->dataInfo($dis);

        return $this->success($data);

    }



    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:颜色筛选列表
     */
    public function colorSelect(){

        $input = $this->_param;

        $color_model = new ScreenColor();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $color_model->where($dis)->select()->toArray();

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:排量筛选列表
     */
    public function displacementSelect(){

        $input = $this->_param;

        $dis_model = new ScreenDisplacement();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        $data = $dis_model->where($dis)->select()->toArray();

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:里程筛选列表
     */
    public function mileageSelect(){

        $input = $this->_param;

        $mileage_model = new ScreenMileage();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $mileage_model->where($dis)->select()->toArray();

        return $this->success($data);

    }


    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:车型筛选列表
     */
    public function modelSelect(){

        $input = $this->_param;

        $model_model = new ScreenModel();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $model_model->where($dis)->select()->toArray();

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:价格筛选列表
     */
    public function priceSelect(){

        $input = $this->_param;

        $price_model = new ScreenPrice();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $price_model->where($dis)->select()->toArray();

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:标准筛选列表
     */
    public function standardSelect(){

        $input = $this->_param;

        $stand_model = new ScreenStandard();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $stand_model->where($dis)->select()->toArray();

        return $this->success($data);

    }

    /**
     * @author chenniang
     * @DataTime: 2021-11-18 17:51
     * @功能说明:车龄筛选列表
     */
    public function yearSelect(){

        $input = $this->_param;

        $year_model = new ScreenYear();

        $dis[] = ['status','=',1];

        $dis[] = ['uniacid','=',$this->_uniacid];

        if(!empty($input['title'])){

            $dis[] = ['title','like','%'.$input['title'].'%'];
        }

        $data = $year_model->where($dis)->select()->toArray();

        return $this->success($data);

    }


}
